package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.collections.CreateProblemCollectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.collections.UpdateProblemCollectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.vo.collections.CollectionProblemVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.collections.ProblemCollectionVO;
import com.wiscamp.ninechapters.problems.domain.models.collections.CollectionProblem;
import com.wiscamp.ninechapters.problems.domain.models.collections.ProblemCollection;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ProblemCollectionAssembler {
    ProblemCollectionAssembler Instance = Mappers.getMapper(ProblemCollectionAssembler.class);

    // region collection
    ProblemCollectionVO toProblemCollectionVO(ProblemCollection entity);

    ProblemCollection fromCreateCommand(CreateProblemCollectionCommand command);

    ProblemCollection fromUpdateCommand(UpdateProblemCollectionCommand command);
    // endregion

    // region collection problem
    CollectionProblemVO toCollectionProblemVO(CollectionProblem entity);
    // endregion
}
